<?php session_start(); ?>
<?php if(false) : ?>
<html>
	<head>
		<title>Auth</title>
	</head>
	<body>
		<form method="POST" act="./auth.php">
			<input type="text" name="login" id="login" value="Login"><br>
			<input type="password" name="pass" id="pass" value="Password"><br>
			<input type="submit" value="Login">
			<input type="reset">
		</form>
	</body>
</html>
<?php endif; ?>
<?php
	echo "<a href=\"./\">Back</a><br>";
	$login = !empty($_POST['login'])?$_POST['login']:"";
	$pass = !empty($_POST['pass'])?$_POST['pass']:"";
	if (!empty($login) && !empty($pass))
	{
			$_SESSION['login'] = $login;
			$_SESSION['pass'] = $pass;
			$_SESSION['hash'] = md5($login . $pass);
			$_SESSION['id'] = $_COOKIE['PHPSESSID'];
			header("Location: ./");
	}
?>